local function getupvaluetable(func, inname)
    local i = 1
    while true do
        local name, value = debug.getupvalue(func, i)
        if name == nil then
            return
        end
        
        if name == inname then
            return i,value
        end
        
        i=i+1
    end
end


local lua = _P.lua
local idx, old_func = getupvaluetable(lua.hall_handler,'REQ_SEVEN_REWARD_CONFIG')
local _,global_configs = getupvaluetable(old_func,'global_configs')

local function REQ_SEVEN_REWARD_CONFIG(msg)
    print_r(global_configs)
    local seven_reward = global_configs.seven_reward
    if not seven_reward then
        return send_to_gateway('hall.RSP_SEVEN_REWARD_CONFIG',{result = -1})
    end

    local data = {}
    for k,v in pairs(seven_reward) do
        local t = {}
        t.coins_low  = v.coins_low
        t.coins_high = v.coins_hight > 5000000 and 5000000 or v.coins_hight
        t.back_rate  = v.back_rate * 100
        table_insert(data,t)
    end
    return send_to_gateway('hall.RSP_SEVEN_REWARD_CONFIG',{config_list = data})
end

lua.hall_handler.REQ_SEVEN_REWARD_CONFIG = REQ_SEVEN_REWARD_CONFIG